using Microsoft.AspNetCore.Mvc;

namespace _29_领域事件发布机制.Controllers
{
    [ApiController]
    [Route("[controller]")]
    public class WeatherForecastController : ControllerBase
    {
        private MyDbContext ctx;

     
        public WeatherForecastController(MyDbContext ctx)
        {
            this.ctx = ctx;
        }

        [HttpGet(Name = "GetWeatherForecast")]
        public async Task<IActionResult> Get()
        {
            var user = new Models.lingyu("Aggie", "111@qq.com");
            user.changePwd("11111");
            ctx.Add(user);
            await ctx.SaveChangesAsync();
            return Ok("ok");
        }
            
    }
}